FILE ORGANIZATION
Sequential file processing means records are in order according to a key field. A people file will be in order by a key that uniquely identifies each person, such as Social Security number or customer number. If a particular record in a sequential file is wanted, then all the prior records in the file must be read before reaching the desire record. Tape storage is limited to sequential file organization. Disk storage may be sequential, but records on disk can also be accessed directly.
Direct file processing, or direct access, allows the computer to go directly to the desired record by using a record key; the computer does not have to read all preceding records in the file as it does if the records are arranged sequentially. Direct processing requires disk storage; in fact, a disk drive is called a direct-access storage device (DASD) because the computer can go directly to the desired record on the disk. It is this ability to access any given record instantly that has made computer systems so convenient for people in service industries - for catalog order-takers determining if a particular sweater is in stock, for example, or bank tellers checking individual bank balances. An added benefit of direct access organization is the ability to read, change, and return to its same place on the disk; this is called updating in place.
Obviously, if we have a completely blank area on the disk and can put records anywhere, then there must be some predictable system for placing a record at a disk address and then retrieving the record at a subsequent time. In other words, once the record has been placed on a disk, it must be possible to find it again. This is done by choosing a certain formula to apply to the record key, thereby deriving a number to use as the disk address. Hashing, or randomizing, is the name given to the process of applying mathematical operation to a key to yield a number that represent the address. Even though the record keys are unique, it is possible for a hashing scheme to produce the same disk address, called a synonym, for two different records; such an occurrence is called a collision. There are various ways to recover from a collision; one way is simply to use the next available record slot on the disk.
Indexed file processing, or indexed processing, is a third method of file organization, and it represents a compromise between the sequential and direct methods. It is useful in applications where a file needs to be in sequential order but, in addition, access to individual records is needed.
An indexed file works as follows: Records are stored in the file in sequential order, but the file also contains an index. The index contains entries consisting of the key to each record stored on the file and the corresponding disk address for that record. The index is like a directory, with the keys to all records listed in order. To access a record directly, the record key must be located in the index; the address associated with the key is then used to locate the record on the disk. To access the entire file of records sequentially, begin with the first record and proceed through the rest of the records.
End
Condensed from:"Computers"Tools for an Information Age" H.L. Capron pp.111-112